import request from '@/utils/request'

// 查询劳务公司列表
export function driverCompanyList(query) {
    return request({
        url: '/driver/driverCompany/list',
        method: 'get',
        params: query
    })
}

// 劳务公司新增(工作流)
export function driverCompanyFlowAdd(data) {
    return request({
        url: '/driver/driverCompany/submit',
        method: 'post',
        data: data
    })
}

// 劳务公司新增
export function driverCompanyAdd(data) {
    return request({
        url: '/driver/driverCompany',
        method: 'post',
        data: data
    })
}

// 劳务公司编辑
export function driverCompanyUpdate(data) {
    return request({
        url: '/driver/driverCompany',
        method: 'put',
        data: data
    })
}

// 劳务公司删除
export function driverCompanyDelete(data) {
    return request({
        url: `/driver/driverCompany`,
        method: 'delete',
        params: data
    })
}

// 查询劳务公司详情
export function driverCompanyDetail(driverId) {
    return request({
        url: `/driver/driverCompany/${driverId}`,
        method: 'get'
    })
}


// 查询司机列表
export function driverList(query) {
    return request({
        url: '/driver/driver/list',
        method: 'get',
        params: query
    })
}

// 司机新增(工作流)
export function driverFlowAdd(data) {
    return request({
        url: '/driver/driver/submit',
        method: 'post',
        data: data
    })
}

// 司机新增
export function driverAdd(data) {
    return request({
        url: '/driver/driver',
        method: 'post',
        data: data
    })
}

// 司机编辑
export function driverUpdate(data) {
    return request({
        url: '/driver/driver',
        method: 'put',
        data: data
    })
}

// 司机删除
export function driverDelete(data) {
    return request({
        url: `/driver/driver`,
        method: 'delete',
        params: data
    })
}

// 查询司机详情
export function driverDetail(driverId) {
    return request({
        url: `/driver/driver/${driverId}`,
        method: 'get'
    })
}

// 下拉框·查询劳务公司列表
export function driverCompanySelect(query) {
    return request({
        url: `/driver/driverCompany/select/list`,
        method: 'get',
        params: query
    })
}

// 根据客户id 查询车辆信息列表
export function getCarInfoByCustomerId(id) {
    return request({
        url: `/driver/driver/getCarInfoByCustomerId/${id}`,
        method: 'get'
    })
}

export const IMPORTDRIVER = '/driver/driver/importDriver'

export function TEMPLATEDRIVER(templateCode) {
    return `/system/templateFile/download/${templateCode}`
}

export const ERRORDRIVER = `/driver/driver/exportTemplate/`
